<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        #box{
            width: 100px;
            height: 100px;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <h1>JS 操作元素的属性</h1>
    <button onclick="makeBig()">点我变大</button>
    <hr>

    <img src="./img1.jpg" width="50" id="myimg">

    <script>
        // CSS样式
        function makeBig() {
            var img = document.getElementById('myimg');
            console.log(img);

            img.width += 100;
        }

    </script>
</body>
</html>